import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    arr: [
      {
        pname: "联想笔记本电脑",
        id: 1,
        uptDate: new Date(),
        // uptDate:"2022-6-22 18:30",
        price: 6000,
        count: 50,
        user: "张三",
        isShow: true
      },
      {
        pname: "宏基笔记本电脑",
        id: 2,
        uptDate: new Date(),
        // uptDate:"2022-6-22 18:32",
        price: 8000,
        count: 30,
        user: "里斯",
        isShow: true
      },
    ],
  },
  getters: {
  },
  mutations: {
    addProduct(state,payload){
      state.arr.push(payload)
    },
    delProduct(state,payload){
      state.arr.splice(payload,1)
    }
  },
  actions: {
  },
  modules: {
  }
})
